package com.greateamd.timetableasy.client.widgets.studyperiod;

import com.greateamd.timetableasy.client.domain.StudyPeriodType;
import com.greateamd.timetableasy.client.widgets.LabelizableListBox;

public final class StudyPeriodTypeListBox extends LabelizableListBox {

	public StudyPeriodTypeListBox() {
		super(false);
		for(StudyPeriodType value : StudyPeriodType.values()){
			if(!value.equals(StudyPeriodType.CUSTOM))
				addValue(value.getText());
		}
	}
	
	public void setValue(StudyPeriodType type) {
		super.setValue(type.getText());
	}
	
	public StudyPeriodType getStudyPeriodTypeSelected(){
		return StudyPeriodType.getStudyPeriodTypeOf(getValue());
	}
}
